<?php
class Helloworld extends Module
{
  /*is invoked automatically when a class is called. I've added my comments below.*/
     function __construct()
    {
        $this->name = 'Currencies';
        $this->tab = 'Blocks';
        $this->version = 1.0;
        parent::__construct(); // The parent construct is required for translations
        $this->page = basename(__FILE__, '.php');
        $this->displayName = $this->l('Block Currencies');
        $this->description = $this->l('Module Currencies');
    }
    /*And what about install() function? Well this is called by prestashop framework. It checks that your module is installed or not, you can modify hook names here. Please note that you have to write a function respective to your hooks defined and you are allowed to add multiple hooks*/
    function install()
    {
        if (!parent::install())
            return false;
        if (!$this->registerHook('leftColumn'))
            return false;
        return true;
    }


 /**
 * Returns module content
 *
 * @param array $params Parameters
 * @return string Content
 */
/*This is last step. We've defined registerHook('leftColumn'), so we've written following function. This method is called by front office to check your content path/variable/smarty etc.*/
    function hookLeftColumn($params)
    {
    	if (Configuration::get('PS_CATALOG_MODE'))
			return ;
	
		global $smarty;
		$currencies = Currency::getCurrencies();
		if (!sizeof($currencies))
			return '';
		$smarty->assign('currencies', $currencies);
    	 return $this->display(__FILE__, 'helloworld.tpl');
    }
}
